package org.df.ulab.bot.plugins.pmi.commons;

import java.io.Serializable;

/**
 * @author Daniel Filgueiras
 * @since 19/06/2011
 */
public class UserSettings implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private Long	lastOnline;
	
	private long 	workingIssue;
	private long	workingStartTime;
	private long	workedTime;
	private boolean	autoTimeControl;
	
	private String	activityId;
	
	private CharSequence issueComment;

	
	public long getWorkedTime() {
		if (workingStartTime != 0) {
			return workedTime + (System.currentTimeMillis() - workingStartTime);
		}
		return workedTime;
	}
	public void resetWork() {
		this.workingIssue = 0;
		this.workingStartTime = 0;
		this.workedTime = 0;
		this.issueComment = "";
	}
	
	
	public Long getLastOnline() {
		return lastOnline;
	}
	public void setLastOnline(Long lastOnline) {
		this.lastOnline = lastOnline;
	}
	
	public long getWorkingIssue() {
		return workingIssue;
	}

	public void setWorkingIssue(int workingIssue) {
		this.workingIssue = workingIssue;
	}

	public long getWorkingStartTime() {
		return workingStartTime;
	}

	public void setWorkingStartTime(long workingStartTime) {
		this.workingStartTime = workingStartTime;
	}

	public CharSequence getIssueComment() {
		return issueComment;
	}

	public void setIssueComment(CharSequence issueComment) {
		this.issueComment = issueComment;
	}
	
	
	public void setWorkedTime(long spendTime) {
		this.workedTime = spendTime;
	}
	
	public void setAutoTimeControl(boolean autoTimeControl) {
		this.autoTimeControl = autoTimeControl;
	}
	public boolean isAutoTimeControl() {
		return autoTimeControl;
	}
	
	public String getActivityId() {
		return activityId;
	}
	public void setActivityId(String activityId) {
		this.activityId = activityId;
	}
}
